<?php
include_once ("httpsqs/httpsqs_client.php");
$httpsqs_host = "localhost";
$httpsqs_port = "1218";
$httpsqs_auth = "";
$httpsqs_charset = "utf-8";

$httpsqs = new httpsqs($httpsqs_host, $httpsqs_port, $httpsqs_auth, $httpsqs_charset);
$result="";
/*
1. check wheather dtn is running

*/
if ($_POST["action"] == "ADD") {
	$add_msg = "route add ".$_POST["eid"]." dtn://*bytewalla.com/* ";
	
	$result = $httpsqs->put("php_python_request", $add_msg);
	sleep(1);
	$result = $httpsqs->get("php_python_reply");
} else
	if ($_POST["action"] == "DEL") {
		$del_msg = "route del ".$_POST["eid"];
		
		$result = $httpsqs->put("php_python_request", $del_msg);
		sleep(1);
		$result = $httpsqs->get("php_python_reply");
	}

header("Location: routeInfo.php");

?>
